home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 4
/
Apprentice-Release4.iso
/
Source Code
/
Libraries
/
Graphic Elements 3
/
GEMisc
/
SFXProcs.c
< prev
next >
Wrap
Text File
|
1995-08-25
|
2KB
|
99 lines
/*
SFXProcs.h
Special effects for Graphic Elements
Copyright 1994 by Al Evans. All rights reserved.
6/9/94
*/
#include "SFXProcs.h"
#include "Rects.h"
pascal void SFXHWipe(SFXCtrlrPtr controller)
{
Rect destRect;
CGrafPtr savePort;
GDHandle gd;
GrafElPtr element = (GrafElPtr) controller;
short cpyWidth;
switch(controller->currentStep) {
case -1:
break;
case 0:
break;
default:
GetGWorld(&savePort, &gd);
SetGWorld(element->graphWorld, nil);
destRect = element->graphRect;
cpyWidth = RectWidth(&destRect) * controller->currentStep / controller->nSteps;
if (controller->forward)
destRect.right = destRect.left + cpyWidth;
else
destRect.left = destRect.right - cpyWidth;
CopyBits(&((GrafPtr) controller->sfxSrc)->portBits,
&((GrafPtr) element->graphWorld)->portBits,
&destRect, &destRect, srcCopy, nil);
SetGWorld(savePort, gd);
break;
}
}
pascal void SFXVWipe(SFXCtrlrPtr controller)
{
Rect destRect;
CGrafPtr savePort;
GDHandle gd;
GrafElPtr element = (GrafElPtr) controller;
short cpyHeight;
switch(controller->currentStep) {
case -1:
break;
case 0:
break;
default:
GetGWorld(&savePort, &gd);
SetGWorld(element->graphWorld, nil);
destRect = element->graphRect;
cpyHeight = RectHeight(&destRect) * controller->currentStep / controller->nSteps;
if (controller->forward)
destRect.bottom = destRect.top + cpyHeight;
else
destRect.top = destRect.bottom - cpyHeight;
CopyBits(&((GrafPtr) controller->sfxSrc)->portBits,
&((GrafPtr) element->graphWorld)->portBits,
&destRect, &destRect, srcCopy, nil);
SetGWorld(savePort, gd);
break;
}
}
pascal void SFXBlink(SFXCtrlrPtr controller)
{
GWorldPtr tmpGWorld;
switch(controller->currentStep) {
case -1:
break;
case 0:
break;
default:
//Total number of switches must be even
if ((controller->currentStep == controller->nSteps) && (controller->nSteps & 1))
return;
tmpGWorld = controller->sfxSrc;
controller->sfxSrc = ((GrafElPtr) controller)->graphWorld;
((GrafElPtr) controller)->graphWorld = tmpGWorld;
break;
}
}